<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>关于[socket.io实现websocket]部分功能的使用 | 蓝湖畔淅淅沥沥的雨</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="JavaScript客户端 1234567891011121314151617&#x2F;&#x2F; 连接请求socket &#x3D; io.connect(&amp;#x27;ws:&#x2F;&#x2F;&amp;#x27; + document.domain + &amp;#x27;:&amp;#x27; + location.port + &amp;#x27;&#x2F;wsmine&amp;#x27;, &amp;#123;            reconnectionDelayMax: 10">
<meta property="og:type" content="article">
<meta property="og:title" content="关于[socket.io实现websocket]部分功能的使用">
<meta property="og:url" content="http://example.com/2022/06/11/%E5%85%B3%E4%BA%8E-socket-io%E5%AE%9E%E7%8E%B0websocket-%E9%83%A8%E5%88%86%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%BF%E7%94%A8/index.html">
<meta property="og:site_name" content="蓝湖畔淅淅沥沥的雨">
<meta property="og:description" content="JavaScript客户端 1234567891011121314151617&#x2F;&#x2F; 连接请求socket &#x3D; io.connect(&amp;#x27;ws:&#x2F;&#x2F;&amp;#x27; + document.domain + &amp;#x27;:&amp;#x27; + location.port + &amp;#x27;&#x2F;wsmine&amp;#x27;, &amp;#123;            reconnectionDelayMax: 10">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-06-11T02:29:30.000Z">
<meta property="article:modified_time" content="2022-06-11T02:48:54.499Z">
<meta property="article:author" content="StarsWhisper">
<meta property="article:tag" content="socket">
<meta property="article:tag" content="python">
<meta property="article:tag" content="javascript">
<meta property="article:tag" content="websocket">
<meta property="article:tag" content="socket.io">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="蓝湖畔淅淅沥沥的雨" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

  
<link rel="stylesheet" href="/plugin/bganimation/bg.css">

  

  <link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" rel="stylesheet" type="text/css">
<meta name="generator" content="Hexo 6.1.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <div class="outer">
        <div class="widget-wrap mobile-header">
  <h3 class="widget-title"></h3>
  <div class="widget">
    <img class="avatar" src="/images/avatar.png">
    <h2 class="author">StarsWhisper</h2>
    <h3 class="description"></h3>
    <div class="count-box">
      <a href="/archives"><div><strong>75</strong><br>文章</div></a>
      <a href="/categories"><div><strong>31</strong><br>分类</div></a>
      <a href="/tags"><div><strong>56</strong><br>标签</div></a>
    </div>
    <ul class="blog-link">
     
          <a href="/" title="Home">
            <li>主页</li>
          </a>
        
          <a href="/archives" title="Archives">
            <li>归档</li>
          </a>
        
          <a href="/categories" title="Categories">
            <li>分类</li>
          </a>
        
          <a href="/tags" title="Tags">
            <li>标签</li>
          </a>
        
          <a href="/knightabout" title="Knightabout">
            <li>关于</li>
          </a>
        
          <a href="/bridges" title="Bridges">
            <li>传送门</li>
          </a>
        
          <a href="/announcement" title="Announcement">
            <li>公告</li>
          </a>
        
    </ul>
  </div>
</div>

        <section id="main"><article id="post-关于-socket-io实现websocket-部分功能的使用" class="wow slideInRight article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2022/06/11/%E5%85%B3%E4%BA%8E-socket-io%E5%AE%9E%E7%8E%B0websocket-%E9%83%A8%E5%88%86%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%BF%E7%94%A8/" class="article-date">
  <time class="post-time" datetime="2022-06-11T02:29:30.000Z" itemprop="datePublished">
    <span class="post-month">6月</span><br/>
    <span class="post-day">11</span>
  </time>
</a>
   
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      关于[socket.io实现websocket]部分功能的使用
    </h1>
  

        <div>
          
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/">基础知识</a>,<a class="article-category-link" href="/categories/%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/socket/">socket</a>
  </div>

          
              

          
        </div>
      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="javascript客户端"><a class="markdownIt-Anchor" href="#javascript客户端"></a> JavaScript客户端</h2>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 连接请求</span></span><br><span class="line">socket = io.<span class="title function_">connect</span>(<span class="string">&#x27;ws://&#x27;</span> + <span class="variable language_">document</span>.<span class="property">domain</span> + <span class="string">&#x27;:&#x27;</span> + location.<span class="property">port</span> + <span class="string">&#x27;/wsmine&#x27;</span>, &#123;</span><br><span class="line">            <span class="attr">reconnectionDelayMax</span>: <span class="number">10000</span>,</span><br><span class="line">    		<span class="comment">//附加在请求里的内容</span></span><br><span class="line">            <span class="attr">query</span>: &#123;</span><br><span class="line">                <span class="string">&quot;cookie&quot;</span>: this_cookie</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;);</span><br><span class="line"><span class="comment">//连接时触发</span></span><br><span class="line"> socket.<span class="title function_">on</span>(<span class="string">&quot;connect&quot;</span>, <span class="function">(<span class="params">rev</span>) =&gt;</span> &#123;</span><br><span class="line">            <span class="title function_">alert</span>(<span class="string">&quot;地图生成时间可能较长，请稍等！\n\n扫雷时请不要快速点击，服务器承受不住！&quot;</span>);</span><br><span class="line">        &#125;)</span><br><span class="line"><span class="comment">//断开时触发</span></span><br><span class="line">socket.<span class="title function_">on</span>(<span class="string">&quot;connect&quot;</span>, <span class="function">(<span class="params">rev</span>) =&gt;</span> &#123;&#125;)</span><br><span class="line"></span><br><span class="line"><span class="comment">//收到特定消息</span></span><br><span class="line">socket.<span class="title function_">on</span>(<span class="string">&quot;your massage name&quot;</span>, <span class="function">(<span class="params">rev</span>) =&gt;</span> &#123;&#125;)</span><br></pre></td></tr></table></figure>
<h2 id="python-flask_socketio-服务端"><a class="markdownIt-Anchor" href="#python-flask_socketio-服务端"></a> python flask_socketio 服务端</h2>
<p>启动脚本</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 文件1</span></span><br><span class="line"><span class="keyword">from</span> flask_socketio <span class="keyword">import</span> SocketIO</span><br><span class="line">clearmind_socketio = SocketIO()</span><br><span class="line"></span><br><span class="line"><span class="comment"># 文件2</span></span><br><span class="line"><span class="keyword">from</span> flask <span class="keyword">import</span> Blueprint</span><br><span class="line">clearmind_blueprint = Blueprint(<span class="string">&#x27;main&#x27;</span>, __name__)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 启动脚本</span></span><br><span class="line"><span class="keyword">from</span> flask <span class="keyword">import</span> Flask</span><br><span class="line"><span class="keyword">from</span> BackEnd.objects <span class="keyword">import</span> clearmind_socketio</span><br><span class="line"><span class="keyword">from</span> BackEnd.routes <span class="keyword">import</span> clearmind_blueprint</span><br><span class="line"><span class="keyword">from</span> flask_cors <span class="keyword">import</span> CORS</span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">create_app</span>(<span class="params">debug = <span class="literal">True</span></span>):</span><br><span class="line">    app = Flask(__name__)</span><br><span class="line">    app.debug = debug</span><br><span class="line">    app.config[<span class="string">&#x27;SECRET_KEY&#x27;</span>] = <span class="string">&#x27;clearmind&#x27;</span></span><br><span class="line">    app.register_blueprint(clearmind_blueprint)</span><br><span class="line">    clearmind_socketio.init_app(app)</span><br><span class="line">    CORS(app, supports_credentials=<span class="literal">True</span>)</span><br><span class="line">    <span class="keyword">from</span> BackEnd <span class="keyword">import</span> events</span><br><span class="line">    <span class="keyword">return</span> app</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    app = create_app()</span><br><span class="line">    clearmind_socketio.run(app, host=<span class="string">&#x27;0.0.0.0&#x27;</span>, port=<span class="number">26666</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>消息规则</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> threading</span><br><span class="line"><span class="keyword">from</span> flask <span class="keyword">import</span> session, request</span><br><span class="line"><span class="keyword">from</span> flask_socketio <span class="keyword">import</span> emit, join_room, leave_room, disconnect</span><br><span class="line"></span><br><span class="line"><span class="comment"># 命名空间wslogin 连接时响应</span></span><br><span class="line"><span class="meta">@clearmind_socketio.on(<span class="params"><span class="string">&#x27;connect&#x27;</span>, namespace=<span class="string">&#x27;/wslogin&#x27;</span></span>)</span></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">login_connect</span>():</span><br><span class="line">    print_and_log(<span class="string">&#x27;收到登录请求...&#x27;</span>)</span><br><span class="line">    <span class="keyword">try</span>:</span><br><span class="line">        username = request.args[<span class="string">&#x27;username&#x27;</span>]</span><br><span class="line">        password = request.args[<span class="string">&#x27;password&#x27;</span>]</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;......&#x27;&#x27;&#x27;</span></span><br><span class="line">        <span class="keyword">if</span> <span class="number">4</span> &lt; <span class="number">5</span>:</span><br><span class="line">            <span class="comment"># 发送reply消息</span></span><br><span class="line">        	emit(<span class="string">&#x27;reply&#x27;</span>, reply)</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="comment"># 发送reply消息</span></span><br><span class="line">        	emit(<span class="string">&#x27;reply&#x27;</span>, <span class="string">&#x27;deny&#x27;</span>)</span><br><span class="line">    <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line">        print_and_log(<span class="built_in">str</span>(<span class="built_in">type</span>(e)),<span class="built_in">str</span>(e))</span><br><span class="line">        disconnect()</span><br><span class="line">        <span class="keyword">return</span> <span class="literal">False</span></span><br><span class="line">   </span><br><span class="line"><span class="comment"># 命名空间wslogin 连接断开时响应</span></span><br><span class="line"><span class="meta">@clearmind_socketio.on(<span class="params"><span class="string">&#x27;disconnect&#x27;</span>, namespace=<span class="string">&#x27;/wslogin&#x27;</span></span>)</span></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">login_disconnect</span>():</span><br><span class="line">    <span class="string">&#x27;&#x27;&#x27;登录连接断开时执行&#x27;&#x27;&#x27;</span></span><br><span class="line">    <span class="keyword">try</span> : </span><br><span class="line">        username = request.args[<span class="string">&#x27;username&#x27;</span>]</span><br><span class="line">        password = request.args[<span class="string">&#x27;password&#x27;</span>]</span><br><span class="line">    <span class="keyword">except</span>:</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    print_and_log(<span class="string">f&#x27;登录连接断开...   <span class="subst">&#123;username&#125;</span>&#x27;</span>)</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line"><span class="comment"># 命名空间wsmine 收到click信息时响应</span></span><br><span class="line"><span class="meta">@clearmind_socketio.on(<span class="params"><span class="string">&#x27;click&#x27;</span>, namespace=<span class="string">&#x27;/wsmine&#x27;</span></span>)</span></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">mine_click</span>(<span class="params">info</span>):</span><br><span class="line">    <span class="string">&#x27;&#x27;&#x27;收到点击地图时间, 把数据中的参数抛给后端处理&#x27;&#x27;&#x27;</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">try</span> :</span><br><span class="line">        cookie = request.args[<span class="string">&#x27;cookie&#x27;</span>]</span><br><span class="line">        data = json.loads(info)</span><br><span class="line">        x, y = data[<span class="string">&#x27;x&#x27;</span>], data[<span class="string">&#x27;y&#x27;</span>]</span><br><span class="line">        username, tm = cookie_user_dict[cookie]</span><br><span class="line">    <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line">        print_and_log(<span class="string">&#x27;&gt;&gt;&gt; error &#x27;</span> +  <span class="built_in">str</span>(<span class="built_in">type</span>(e)) + <span class="string">&#x27; &#x27;</span> + <span class="built_in">str</span>(e))</span><br><span class="line">        disconnect()</span><br><span class="line">        <span class="keyword">return</span> <span class="literal">False</span></span><br><span class="line"></span><br><span class="line">    <span class="string">&#x27;&#x27;&#x27;代码&#x27;&#x27;&#x27;</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment"># 广播broadcast消息</span></span><br><span class="line">    emit(<span class="string">&#x27;broadcast&#x27;</span>, json.dumps(&#123;<span class="string">&#x27;x&#x27;</span> : x, <span class="string">&#x27;y&#x27;</span> : y, <span class="string">&#x27;color&#x27;</span> : color, <span class="string">&#x27;timmer&#x27;</span> : timmer, <span class="string">&#x27;username&#x27;</span> : username&#125;), broadcast = <span class="literal">True</span>)</span><br><span class="line"></span><br><span class="line">    <span class="string">&#x27;&#x27;&#x27;代码&#x27;&#x27;&#x27;</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment"># 广播game end消息</span></span><br><span class="line">    emit(<span class="string">&#x27;game end&#x27;</span>, json.dumps(CM_server.rank()), broadcast = <span class="literal">True</span>)</span><br><span class="line">    </span><br><span class="line">    <span class="string">&#x27;&#x27;&#x27;代码&#x27;&#x27;&#x27;</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment"># 广播args 消息</span></span><br><span class="line">    emit(<span class="string">&#x27;args&#x27;</span>, json.dumps(CM_server.args()), broadcast = <span class="literal">True</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://example.com/2022/06/11/%E5%85%B3%E4%BA%8E-socket-io%E5%AE%9E%E7%8E%B0websocket-%E9%83%A8%E5%88%86%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%BF%E7%94%A8/" data-id="cl49a2qlk000098j3a8tx2wsx" class="article-share-link">分享</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/javascript/" rel="tag">javascript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/socket/" rel="tag">socket</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/socket-io/" rel="tag">socket.io</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/websocket/" rel="tag">websocket</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2022/06/11/%E6%B1%82%E7%94%9F%E4%B9%8B%E8%B7%AF2zonemod%E8%8D%AF%E6%8A%97%E6%8F%92%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%90%AD%E5%BB%BA/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">上一篇</strong>
      <div class="article-nav-title">
        
          求生之路2zonemod药抗插件服务器搭建
        
      </div>
    </a>
  
  
    <a href="/2022/06/11/%E5%85%B3%E4%BA%8Esocket%E9%83%A8%E5%88%86%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%BF%E7%94%A8/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">下一篇</strong>
      <div class="article-nav-title">关于socket部分功能的使用</div>
    </a>
  
</nav>

  
</article>



</section>
        
          <aside id="sidebar">
  
    <div class="widget-wrap">
  <h3 class="widget-title"></h3>
  <div class="widget">
    <h1 class="blog-title">蓝湖畔淅淅沥沥的雨</h1>
    <h2 class="blog-subtitle">All tragedy erased, I see only wonders...</h2>
    <ul class="blog-link">
     
          <a href="/" title="Home">
            <li>主页</li>
          </a>
        
          <a href="/archives" title="Archives">
            <li>归档</li>
          </a>
        
          <a href="/categories" title="Categories">
            <li>分类</li>
          </a>
        
          <a href="/tags" title="Tags">
            <li>标签</li>
          </a>
        
          <a href="/knightabout" title="Knightabout">
            <li>关于</li>
          </a>
        
          <a href="/bridges" title="Bridges">
            <li>传送门</li>
          </a>
        
          <a href="/announcement" title="Announcement">
            <li>公告</li>
          </a>
        
    </ul>
  </div>
</div>

  
    <div class="widget-wrap">
  <h3 class="widget-title"></h3>
  <div class="widget">
    <img class="avatar" src="/images/avatar.png">
    <h2 class="author">StarsWhisper</h2>
    <h3 class="description"></h3>
    <div class="count-box">
      <a href="/archives"><div><strong>75</strong><br>文章</div></a>
      <a href="/categories"><div><strong>31</strong><br>分类</div></a>
      <a href="/tags"><div><strong>56</strong><br>标签</div></a>
    </div>



    <div class="social-link">
      
        <a class="hvr-bounce-in" href="https://github.com/Wldcmzy" target="_blank" title="Github">
          Github
        </a>
      
        <a class="hvr-bounce-in" href="https://blog.csdn.net/wldcmzy" target="_blank" title="CSDN">
          CSDN
        </a>
      
        <a class="hvr-bounce-in" href="https://space.bilibili.com/83743701" target="_blank" title="bilibili(无技术和学习内容)">
          bilibili(无技术和学习内容)
        </a>
      
    </div>

    <div class="friend-link">
      <h2>友情链接</h2>
      
        <a class="hvr-bounce-in" href="https://shanamaid.github.io/" target="_blank" title="夏娜主题作者的博客">
          夏娜主题作者的博客
        </a>
      
    </div>
  </div>
</div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy;2021 - 2022 StarsWhisper<br>
      由<a href="http://hexo.io/" target="_blank">Hexo</a>强力驱动 | 
      主题-<a target="_blank" rel="noopener" href="https://github.com/ShanaMaid/hexo-theme-shana">Shana</a>(但是魔改)
      
    </div>
    
  </div>
</footer>
    </div>
    

<script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="//apps.bdimg.com/libs/wow/0.1.6/wow.min.js"></script>
<script>
new WOW().init();
</script>   


  
<link rel="stylesheet" href="/plugin/fancybox/jquery.fancybox.css">

  
<script src="/plugin/fancybox/jquery.fancybox.pack.js"></script>




  
<link rel="stylesheet" href="/plugin/galmenu/GalMenu.css">

  
<script src="/plugin/galmenu/GalMenu.js"></script>

  <div class="GalMenu GalDropDown">
      <div class="circle" id="gal">
        <div class="ring">
          
            <a href="/announcement" title="" class="menuItem">公告</a>
          
            <a href="/tags" title="" class="menuItem">标签</a>
          
            <a href="/categories" title="" class="menuItem">分类</a>
          
            <a href="/archives" title="" class="menuItem">归档</a>
          
            <a href="/knightabout" title="" class="menuItem">关于</a>
          
            <a href="/bridges" title="" class="menuItem">传送门</a>
          
        </div>
        
          <audio id="audio" src="#"></audio>
        
      </div> 
</div>
<div id="overlay" style="opacity: 1; cursor: pointer;"></div>
  <script type="text/javascript">var items = document.querySelectorAll('.menuItem');
    for (var i = 0,
    l = items.length; i < l; i++) {
      items[i].style.left = (50 - 35 * Math.cos( - 0.5 * Math.PI - 2 * (1 / l) * i * Math.PI)).toFixed(4) + "%";
      items[i].style.top = (50 + 35 * Math.sin( - 0.5 * Math.PI - 2 * (1 / l) * i * Math.PI)).toFixed(4) + "%"
    }</script>
<script type="text/javascript">
  $(document).ready(function() {
    $('body').GalMenu({
      'menu': 'GalDropDown'
    })
  });
</script>

  <section class="hidden-xs"> 
  <ul class="cb-slideshow"> 
    <li><span>苟利</span></li> 
    <li><span>国家</span></li> 
    <li><span>生死以</span></li> 
    <li><span>岂能</span></li> 
    <li><span>祸福</span></li> 
    <li><span>趋避之</span></li> 
  </ul>
</section>

<script src="/js/script.js"></script>




  </div>
</body>
</html>